/*
 * @Author: sunday
 * @Date: 2020-07-29 09:26:49
 * @LastEditors: sunday
 * @LastEditTime: 2020-08-24 15:43:35
 * @Description: 饼图图表
 */
//饼图-1
var chart_pie_1 = function(pxdata, pydata) {
	var mychart = echarts.init(document.getElementById('pie-1'));
	var color_arr = ['#3196fa', '#00ffc6', '#00cd60', '#ffa800'];
	var name_arr = pxdata || ['项目1', '项目2', '项目3', '项目4'];
	var ydata = pydata || S_mock.array(4, 100, 200);
	var seri_data = [];
	var dw = '项';
	for(const key in name_arr) {
		if(key == 0) {
			seri_data.push({
				name: name_arr[key],
				value: ydata[key],
				label: {
					show: true
				}
			})
		} else {
			seri_data.push({
				name: name_arr[key],
				value: ydata[key]
			})
		}
	}
	var option = {
		color: color_arr,
		title: {
			show: false,
			left: 'center',
			top: 'top',
			text: '标题',
			textStyle: {
				fontWeight: 'normal',
				color: '#facc14',
			},
		},
		tooltip: {
			trigger: 'item',
			formatter: "{b}: {c} ({d}%)"
		},
		legend: {
			y: 'center',
			right: '4%',
			// itemWidth: getSize(0.24),
			// itemHeight: getSize(0.14),
			// itemGap: getSize(0.2),
			icon: 'roundRect',
			formatter: function(para) {
				var str = '{a|' + para + '} {b|';
				str += ydata[name_arr.indexOf(para)] + '}  {c|' + dw + '}';
				if(para = '其他') {
					str = str.replace(/其他/, '其他');
				}
				return str;
			},
			textStyle: {
				padding: [getSize(0.1), getSize(0.2), 0, 0],
				rich: {
					a: {
						fontSize: getSize(0.3),
						color: '#fff'
					},
					b: {
						fontSize: getSize(0.3),
						color: '#facc14'
					},
					c: {
						fontSize: getSize(0.24),
						color: '#fff'
					}
				}
			},
			orient: 'vertical', //horizontal 水平 vertical 垂直
			data: name_arr
		},
		series: [{
			name: '',
			type: 'pie',
			clockWise: false,
			center: ['30%', '50%'],
			radius: ['60%', '75%'],
			startAngle: 90,
			label: {
				show: false,
				fontSize: 16,
				fontFamily: 'DIN',
				position: 'center',
				formatter: '{a|' + getArrSum(ydata) + '}\n{b|总计}',
				rich: {
					a: {
						fontSize: getSize(0.44),
						color: '#FFA800'
					},
					b: {
						fontSize: getSize(0.24),
						color: '#fff'
					}
				}
			},
			labelLine: {
				show: true
			},
			data: seri_data
		}]
	}
	mychart.setOption(option);
};
//饼图-2
var chart_pie_2 = function(pxdata, pydata) {
	var colorArr = ['#FACC14', '#F44660', '#00FF00', '#9696FF', '#3196FA'];
	var valueArr = [92, 20, 10, 2, 1];
	var nameArr = ['项目1', '项目2', '项目3', '项目4', '项目5'];
	var dataArr = [];
	var legendArr = [];
	for(var i = 0; i < nameArr.length; i++) {
		dataArr.push({
			name: nameArr[i],
			value: valueArr[i]
		});
		legendArr.push({
			icon: 'roundRect',
			name: nameArr[i],
		});
	}
	var mychart = echarts.init(document.getElementById('pie-2'));
	var option = {
		color: colorArr,
		title: {
			left: '40%',
			top: '25%',
			text: ' 125\n  项',
			textStyle: {
				fontSize: getSize(0.6),
				fontWeight: 'normal',
				color: '#facc14',
			},
		},
		tooltip: {
			trigger: 'item',
			formatter: "{a} <br/>{b}: {c} ({d}%)"
		},
		legend: {
			bottom: '0%',
			width: '60%',
			height: '30%',
			itemWidth: getSize(0.2),
			itemHeight: getSize(0.16),
			itemGap: getSize(0.16),
			formatter: function(para) {
				var str = '{a|' + para + '} {b|';
				str += valueArr[nameArr.indexOf(para)] + '}  {c|项}';
				if(para = '其他') {
					str = str.replace(/其他/, '其他       ');
				}
				return str;
			},
			textStyle: {
				padding: [getSize(0.1), getSize(0.2), 0, 0],
				rich: {
					a: {
						fontSize: getSize(0.3),
						color: '#fff'
					},
					b: {
						fontSize: getSize(0.3),
						color: '#facc14'
					},
					c: {
						fontSize: getSize(0.3),
						color: '#facc14'
					}
				}
			},
			orient: 'vertical',
			data: legendArr
		},
		series: [{
			name: '非遗代表性项目数',
			type: 'pie',
			clockWise: true,
			center: ['50%', '35%'],
			radius: ['45%', '55%'],
			startAngle: 90,
			itemStyle: {
				normal: {
					label: {
						show: false,
						fontSize: 16,
						fontFamily: 'DIN',
						formatter: '{c}',
					},
					labelLine: {
						show: true
					}
				}
			},
			data: dataArr
		}]
	}
	mychart.setOption(option);
}
//饼图-3
var chart_pie_3 = function(pxdata, pydata) {
	var colorArr = ['#E4FF00', '#F44660', '#FF9600', '#9696FF', '#3196FA', '#00D564', '#00FFFC'];
	var valueArr = [750, 780, 500, 10500, 800, 450, 300];
	var nameArr = ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'];
	var dataArr = [];
	var legendArr = [];
	for(var i = 0; i < nameArr.length; i++) {
		dataArr.push({
			name: nameArr[i],
			value: valueArr[i]
		});
		legendArr.push({
			icon: 'rect',
			name: nameArr[i],
		});
	}
	var mychart = echarts.init(document.getElementById('pie-3'));
	var option = {
		color: colorArr,
		tooltip: {
			trigger: 'item',
			formatter: "{a} <br/>{b}: {c} 米"
		},
		legend: {
			y: 'center',
			right: '0%',
			itemWidth: getSize(0.24),
			itemHeight: getSize(0.24),
			itemGap: getSize(0.1),
			textStyle: {
				padding: [getSize(0.1), 0, 0, 0],
				rich: {
					a: {
						fontSize: getSize(0.28),
						color: '#fff'
					},
					b: {
						fontSize: getSize(0.24),
						color: '#facc14'
					},
					c: {
						fontSize: getSize(0.24),
						color: '#facc14'
					}
				}
			},
			formatter: function(para) {
				var str = '{a|' + para + '} {b|';
				str += valueArr[nameArr.indexOf(para)] + '}  {c|米}';
				if(para = '其他') {
					str = str.replace(/其他/, '其他       ');
				}
				return str;
			},
			orient: 'vertical',
			data: legendArr
		},
		series: [{
			name: '特色街区长度',
			type: 'pie',
			clockWise: false,
			center: ['25%', '50%'],
			radius: ['0%', '60%'],
			startAngle: 90,
			itemStyle: {
				normal: {
					label: {
						show: false,
						fontSize: 16,
						fontFamily: 'DIN',
						formatter: '{c}',
					},
					labelLine: {
						show: true
					}
				}
			},
			data: dataArr
		}]
	}
	mychart.setOption(option);
}
//饼图-4
var chart_pie_4 = function(pxdata, pydata) {
	var colorArr = ['#ffa800', '#00ffb4', '#fffc00', '#00f0ff', '#f12961', '#00bc2c', '#8882ff', '#ff7200', '#3196fa'];
	var valueArr = [900, 900, 900, 900, 900, 900, 900, 900, 900];
	var nameArr = ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7', '项目8', '项目9'];
	var dataArr = [];
	var legendArr = [];
	for(var i = 0; i < nameArr.length; i++) {
		dataArr.push({
			name: nameArr[i],
			value: valueArr[i]
		});
		legendArr.push({
			icon: 'rect',
			name: nameArr[i],
		});
	}
	var mychart = echarts.init(document.getElementById('pie-4'));
	var option = {
		color: colorArr,
		title: {
			left: '35%',
			top: '25%',
			text: ' 已处理:8613个\n\n 未处理:8613个',
			textStyle: {
				fontSize: getSize(0.25),
				fontWeight: 'normal',
				color: '#facc14'
			},
		},
		tooltip: {
			trigger: 'item',
			formatter: "{a} <br/>{b}: {c} ({d}%)"
		},
		legend: {
			y: 'bottom',
			right: '10%',
			itemWidth: getSize(0.3),
			// itemHeight: getSize(0.2),
			itemGap: getSize(0.4),
			formatter: function(para) {
				var str = '{a|' + para + '}';
				// str += valueArr[nameArr.indexOf(para)] + '}';
				if(para = '其他') {
					str = str.replace(/其他/, '其他       ');
				}
				return str;
			},
			textStyle: {
				padding: [0, 0, 0, 0],
				rich: {
					a: {
						fontSize: getSize(0.3),
						color: '#fff'
					},
					b: {
						fontSize: getSize(0.3),
						color: '#facc14'
					},
					c: {
						fontSize: getSize(0.3),
						color: '#facc14'
					}
				}
			},
			orient: 'horizontal',
			data: legendArr
		},
		series: [{
			name: '学校总数',
			type: 'pie',
			clockWise: true,
			center: ['50%', '30%'],
			radius: ['45%', '55%'],
			startAngle: 90,
			label: {
				normal: {
					show: false,
					position: 'center'
				},
				emphasis: {
					show: true,
					formatter: '{d}%',
					textStyle: {
						fontSize: getSize(.3),
						fontWeight: 'bold',
						padding: [0, 0, getSize(1), 0]
					}
				}
			},
			itemStyle: {
				normal: {
					label: {
						show: false,
						fontSize: 16,
						fontFamily: 'DIN',
						formatter: '{c}',
					},
					labelLine: {
						show: true
					}
				}
			},
			data: dataArr
		}]
	}
	mychart.setOption(option);
}
//饼图-5
var chart_pie_5 = function(pxdata, pydata) {
	var colorArr = ['#FFA800', '#3196FA'];
	var nameArr = pxdata || ['项目1', '项目2'];
	var valueArr = pydata || S_mock.array(2, 100, 200);
	var dataArr = [];
	var legendArr = [];
	for(var i = 0; i < nameArr.length; i++) {
		dataArr.push({
			name: nameArr[i],
			value: valueArr[i]
		});
		legendArr.push({
			icon: 'rect',
			name: nameArr[i],
		});
	}
	var mychart = echarts.init(document.getElementById('pie-5'));
	var option = {
		color: colorArr,
		tooltip: {
			trigger: 'item',
			formatter: "{a} <br/>{b}: {c} ({d}元)"
		},
		legend: {
			y: 'center',
			right: '15%',
			itemWidth: getSize(0.4),
			itemHeight: getSize(0.24),
			itemGap: getSize(0.1),
			textStyle: {
				padding: [getSize(0.1), 0, 0, 0],
				rich: {
					a: {
						fontSize: getSize(0.28),
						color: '#fff'
					},
					b: {
						fontSize: getSize(0.24),
						color: '#facc14'
					},
					c: {
						fontSize: getSize(0.24),
						color: '#facc14'
					}
				}
			},
			formatter: function(para) {
				var str = '{a|' + para + '} {b|';
				str += valueArr[nameArr.indexOf(para)] + '}  {c|元}';
				if(para = '其他') {
					str = str.replace(/其他/, '其他       ');
				}
				return str;
			},
			orient: 'vertical',
			data: legendArr
		},
		series: [{
			name: '累计未支付金额和履约金额占比',
			type: 'pie',
			clockWise: false,
			center: ['30%', '55%'],
			radius: ['0%', '60%'],
			startAngle: 90,
			itemStyle: {
				normal: {
					label: {
						show: true,
						fontSize: 16,
						fontFamily: 'DIN',
						// formatter: '{c}',
						formatter: '{d}%',
					},
					labelLine: {
						show: true
					}
				}
			},
			data: dataArr
		}]
	}
	mychart.setOption(option);
}
//饼图-6
var chart_pie_6 = function(pxdata, pydata) {
	var colorArr = ['#3196FA', '#BB9AFF', '#00D564', '#FFCC00', '#FF506D'];
	var valueArr = [1200, 1200, 1200, 1200, 1200];
	var nameArr = ['项目1', '项目2', '项目3', '项目4', '项目5']
	var dataArr = [];
	var legendArr = [];
	for(var i = 0; i < nameArr.length; i++) {
		if(i === 0) {
			dataArr.push({
				name: nameArr[i],
				value: valueArr[i],
				label: {
					show: true
				}
			});
			legendArr.push({
				icon: 'roundRect',
				name: nameArr[i],
			});
		} else {
			dataArr.push({
				name: nameArr[i],
				value: valueArr[i]
			});
			legendArr.push({
				icon: 'roundRect',
				name: nameArr[i],
			});
		}

	}
	var mychart = echarts.init(document.getElementById('pie-6'));
	var option = {
		color: colorArr,
		// title: {
		//     left: '20%',
		//     top: '45%',
		//     text: ' 42191\n    人',
		//     textStyle: {
		//         fontSize: getSize(0.35),
		//         fontWeight: 'normal',
		//         color: '#facc14',
		//     },
		// },
		tooltip: {
			trigger: 'item',
			formatter: "{b}: {c}件 ({d}%)"
		},
		legend: {
			y: 'center',
			right: '0%',
			itemWidth: getSize(0.24),
			itemHeight: getSize(0.14),
			itemGap: getSize(0.16),
			formatter: function(para) {
				var pct = (valueArr[nameArr.indexOf(para)] / getArrSum(valueArr) * 100).toFixed(2);
				var str = '{a|' + para + '}';
				if(nameArr.indexOf(para) === 0) {
					str += '{b|' + pct + '%}' + '{b1|' + valueArr[nameArr.indexOf(para)] + ' 件}';
				} else if(nameArr.indexOf(para) === 1) {
					str += '{c|' + pct + '%}' + '{c1|' + valueArr[nameArr.indexOf(para)] + ' 件}';
				} else if(nameArr.indexOf(para) === 2) {
					str += '{d|' + pct + '%}' + '{d1|' + valueArr[nameArr.indexOf(para)] + ' 件}';
				} else if(nameArr.indexOf(para) === 3) {
					str += '{e|' + pct + '%}' + '{e|' + valueArr[nameArr.indexOf(para)] + ' 件}';
				} else if(nameArr.indexOf(para) === 4) {
					str += '{f|' + pct + '%}' + '{f|' + valueArr[nameArr.indexOf(para)] + ' 件}';
				}
				return str;
			},
			textStyle: {
				rich: {
					a: {
						width: getSize(1.4),
						// padding: [0, 5, 0, 0],
						fontSize: getSize(0.24),
						color: '#fff'
					},
					b: {
						width: getSize(1.2),
						fontSize: getSize(0.24),
						color: colorArr[0]
					},
					b1: {
						width: getSize(1),
						fontSize: getSize(0.24),
						color: colorArr[0]
					},
					c: {
						width: getSize(1.2),
						fontSize: getSize(0.24),
						color: colorArr[1]
					},
					c1: {
						width: getSize(1),
						fontSize: getSize(0.24),
						color: colorArr[1]
					},
					d: {
						width: getSize(1.2),
						fontSize: getSize(0.24),
						color: colorArr[2]
					},
					d1: {
						width: getSize(1),
						fontSize: getSize(0.24),
						color: colorArr[2]
					},
					e: {
						width: getSize(1.2),
						fontSize: getSize(0.24),
						color: colorArr[3]
					},
					e1: {
						width: getSize(1),
						fontSize: getSize(0.24),
						color: colorArr[3]
					},
					f: {
						width: getSize(1.2),
						fontSize: getSize(0.24),
						color: colorArr[4]
					},
					f1: {
						width: getSize(1),
						fontSize: getSize(0.24),
						color: colorArr[4]
					}
				}
			},
			orient: 'vertical',
			data: legendArr
		},
		series: [{
			name: '',
			type: 'pie',
			clockWise: true,
			center: ['30%', '55%'],
			radius: ['70%', '90%'],
			startAngle: 90,
			label: {
				show: false,
				position: 'center',
				formatter: '{a|总量}\n{b|9316}',
				rich: {
					a: {
						fontSize: getSize(0.26),
						padding: [10, 0, 0, 0],
						color: '#fff'
					},
					b: {
						fontSize: getSize(0.43),
						color: '#3196fa'
					}
				}
			},
			data: dataArr
		}]
	}
	mychart.clear();
	mychart.setOption(option);
}
//饼图-7
var chart_pie_7 = function(pxdata, pydata) {
	var myChart = echarts.init(document.getElementById('pie-7'));
	var colorArr = ['#00ff4e', '#ffa800', '#3196fa'];
	var dataArr = [];
	var legendArr = [];
	var nameArr = ['在建项目', '开工项目', '竣工项目'];
	var valueArr = [46, 23, 31];
	for(var i = 0; i < nameArr.length; i++) {
		if(i === 0) {
			dataArr.push({
				name: nameArr[i],
				value: valueArr[i],
				label: {
					show: true
				}
			});
		} else {
			dataArr.push({
				name: nameArr[i],
				value: valueArr[i],
			});
		}

		legendArr.push({
			icon: 'roundRect',
			name: nameArr[i]
		});
	}
	var option = {
		color: colorArr,
		title: {
			text: '项目总数量',
			x: 'center',
			top: '0%',
			textStyle: {
				fontWeight: 'normal',
				fontSize: getSize(0.32),
				color: '#fff'
			}
		},
		legend: {
			top: '30%',
			right: '2%',
			itemWidth: getSize(0.34),
			itemHeight: getSize(0.27),
			itemGap: getSize(0.2),
			textStyle: {
				fontSize: getSize(0.24),
				color: '#fff'
			},
			orient: 'vertical',
			data: legendArr
		},
		tooltip: {
			trigger: 'item',
			formatter: "{a} <br/>{b}: {c} ({d}%)",
		},
		series: [{
			name: '建设工程',
			type: 'pie',
			clockWise: true,
			radius: ['40%', '55%'],
			center: ['35%', '52%'],
			startAngle: 90,
			label: {
				show: false,
				position: 'center',
				formatter: '{a|40%}\n{b|在建}',
				rich: {
					a: {
						fontSize: getSize(0.44),
						color: '#00ff4e'
					},
					b: {
						fontSize: getSize(0.24),
						color: '#fff'
					}
				}
			},
			labelLine: {
				show: false
			},
			data: dataArr,
		}]
	}
	myChart.setOption(option);
}
//饼图-8
var chart_pie_8 = function(pdata) {
	var mychart = echarts.init(document.getElementById('pie-8'));
	var color_arr = ['#00BD65', '#004181'];
	var name_arr = ['百分比', '总计'];
	var ydata = pdata || S_mock.number(40, 60);
	var seri_data = [];
	for(const key in name_arr) {
		if(key == 0) {
			seri_data.push({
				value: ydata,
				label: {
					show: true
				}
			})
		} else {
			seri_data.push({
				value: 100 - ydata
			})
		}
	}
	var option = {
		color: color_arr,
		title: {
			text: '楼宇入住率',
			left: 'center',
			top: 'top',
			textStyle: {
				color: '#fff',
				fontWeight: 'normal',
				fontSize: getSize(0.32)
			}
		},
		tooltip: {
			show: false,
			trigger: 'item',
			formatter: "{b}: {c} ({d}%)"
		},
		legend: {
			show: false,
			y: 'bottom',
			x: 'center',
			itemWidth: getSize(0.39),
			itemHeight: getSize(0.17),
			itemGap: getSize(0),
			icon: 'roundRect',
			formatter: function(para) {
				if(name_arr.indexOf(para) == 0) {
					var str = '{a|' + para + '} {b|';
					str += ydata[name_arr.indexOf(para)] + '场}';
				} else if(name_arr.indexOf(para) == 1) {
					var str = '{a|' + para + '} {b1|';
					str += ydata[name_arr.indexOf(para)] + '场}';
				} else if(name_arr.indexOf(para) == 2) {
					var str = '{a|' + para + '} {b2|';
					str += ydata[name_arr.indexOf(para)] + '场}';
				} else if(name_arr.indexOf(para) == 3) {
					var str = '{a|' + para + '} {b3|';
					str += ydata[name_arr.indexOf(para)] + '场}';
				}
				return str;
			},
			textStyle: {
				padding: [getSize(0.1), getSize(0.2), 0, 0],
				rich: {
					a: {
						fontSize: getSize(0.24),
						color: '#fff'
					},
					b: {
						fontSize: getSize(0.28),
						color: color_arr[0]
					},
					b1: {
						fontSize: getSize(0.28),
						color: color_arr[1]
					},
					b2: {
						fontSize: getSize(0.28),
						color: color_arr[2]
					},
					b3: {
						fontSize: getSize(0.28),
						color: color_arr[3]
					},
				}
			},
			orient: 'vertical', //horizontal 水平 vertical 垂直
			data: name_arr
		},
		series: [{
			name: '',
			type: 'pie',
			clockWise: true,
			center: ['50%', '55%'],
			radius: ['60%', '70%'],
			startAngle: 90,
			label: {
				show: false,
				fontSize: 16,
				fontFamily: 'DIN',
				position: 'center',
				formatter: '{a|' + ydata + '}{b|%}',
				rich: {
					a: {
						fontSize: getSize(0.48),
						color: '#FACC14'
					},
					b: {
						fontSize: getSize(0.48),
						color: '#FACC14'
					}
				}
			},
			labelLine: {
				show: true
			},
			data: seri_data
		}]
	}
	mychart.setOption(option);
}

//饼图-9
var chart_pie_9 = function(pxdata, pydata) {
	var colorArr = ['#D75E38', '#16B179', '#D99610', '#188FDE', '#23C6CC'];
	var nameArr = pxdata || ['政务热线', '政务热线2', '政务热线3', '政务热线4', '政务热线5'];
	var valueArr = pydata || S_mock.array(nameArr.length, 100, 200);
	var dataArr = [];
	var legendArr = [];
	for(var i = 0; i < nameArr.length; i++) {
		dataArr.push({
			name: nameArr[i],
			value: valueArr[i]
		});
		legendArr.push({
			icon: 'rect',
			name: nameArr[i],
		});
	}
	var mychart = echarts.init(document.getElementById('pie-9'));
	var option = {
		color: colorArr,
		tooltip: {
			trigger: 'item',
			// formatter: "{a} <br/>{b}: {c} ({d}元)"
		},
		legend: {
			show: false,
			y: 'center',
			right: '15%',
			itemWidth: getSize(0.4),
			itemHeight: getSize(0.24),
			itemGap: getSize(0.1),
			textStyle: {
				padding: [getSize(0.1), 0, 0, 0],
				rich: {
					a: {
						fontSize: getSize(0.28),
						color: '#fff'
					},
					b: {
						fontSize: getSize(0.24),
						color: '#facc14'
					},
					c: {
						fontSize: getSize(0.24),
						color: '#facc14'
					}
				}
			},
			formatter: function(para) {
				var str = '{a|' + para + '} {b|';
				str += valueArr[nameArr.indexOf(para)] + '}  {c|元}';
				if(para = '其他') {
					str = str.replace(/其他/, '其他       ');
				}
				return str;
			},
			orient: 'vertical',
			data: legendArr
		},
		series: [{
			name: '',
			type: 'pie',
			clockWise: true,
			center: ['50%', '50%'],
			radius: ['50%', '60%'],
			startAngle: 90,
			itemStyle: {
				normal: {
					label: {
						show: true,
						fontSize: 16,
						fontFamily: 'DIN',
						color: '#02A0C6',
						formatter: '{b}\n{d}%',
					},
					labelLine: {
						show: true,
						lineStyle: {
							color: '#02A0C6',
						}
					}
				}
			},
			data: dataArr
		}]
	}
	mychart.setOption(option);
}

//饼图-10
var chart_pie_10 = function(pxdata, pydata) {
	var colorArr = ['#0089fd', '#0af9be', '#f9bc31', '#cb3458'];
	var valueArr = [1200, 1200, 1200, 1200];
	var nameArr = ['劳动人事类', '交通运输类', '交通运输类2', '交通类']
	var dataArr = [];
	var legendArr = [];
	for(var i = 0; i < nameArr.length; i++) {
		if(i === 0) {
			dataArr.push({
				name: nameArr[i],
				value: valueArr[i],
				label: {
					show: true
				}
			});
			legendArr.push({
				icon: 'roundRect',
				name: nameArr[i],
			});
		} else {
			dataArr.push({
				name: nameArr[i],
				value: valueArr[i]
			});
			legendArr.push({
				icon: 'roundRect',
				name: nameArr[i],
			});
		}

	}
	var mychart = echarts.init(document.getElementById('pie-10'));
	var option = {
		color: colorArr,
		tooltip: {
			trigger: 'item',
			formatter: "{b}: {c}个 ({d}%)"
		},
		legend: {
			y: 'center',
			right: '0%',
			itemWidth: getSize(0.24),
			itemHeight: getSize(0.14),
			itemGap: getSize(0.25),
			formatter: function(para) {
				var pct = (valueArr[nameArr.indexOf(para)] / getArrSum(valueArr) * 100).toFixed(2);
				var str = '{a|' + para + '}';
				if(nameArr.indexOf(para) === 0) {
					str += '{b|' + pct + '%}';
				} else if(nameArr.indexOf(para) === 1) {
					str += '{c|' + pct + '%}';
				} else if(nameArr.indexOf(para) === 2) {
					str += '{d|' + pct + '%}';
				} else if(nameArr.indexOf(para) === 3) {
					str += '{e|' + pct + '%}';
				}
				return str;
			},
			textStyle: {
				rich: {
					a: {
						width: getSize(1.4),
						//padding: [0, 5, 0, 0],
						fontSize: getSize(0.24),
						color: '#fff'
					},
					b: {
						width: getSize(1.5),
						fontSize: getSize(0.24),
						color: '#fff'
						//color: colorArr[0]
					},
					c: {
						width: getSize(1.5),
						fontSize: getSize(0.24),
						color: '#fff'
						//color: colorArr[1]
					},
					d: {
						width: getSize(1.5),
						fontSize: getSize(0.24),
						color: '#fff'
						//color: colorArr[2]
					},
					e: {
						width: getSize(1.5),
						fontSize: getSize(0.24),
						color: '#fff'
						//color: colorArr[3]
					},
				}
			},
			orient: 'vertical',
			data: legendArr
		},
		series: [{
			name: '',
			type: 'pie',
			clockWise: true,
			center: ['32%', '50%'],
			radius: ['60%', '80%'],
			startAngle: 90,
			itemStyle: {
				borderWidth: 3,
				borderColor: '#07294d'
			},
			label: {
				show: false,
				position: 'center',
				formatter: '{a|21114}\n{b|件}',
				rich: {
					a: {
						fontSize: getSize(0.63),
						padding: [10, 0, 0, 0],
						color: '#FEFEFD'
					},
					b: {
						fontSize: getSize(0.4),
						color: '#FEFEFD'
					}
				}
			},
			data: dataArr
		}]
	}
	mychart.clear();
	mychart.setOption(option);
}

//饼图-11
var chart_pie_11 = function(pxdata, pydata) {
	var mychart = echarts.init(document.getElementById('pie-11'));
	var color_arr = ['#E4FF00', '#F44660', '#FF9600', '#9696FF', '#3196FA', '#00D564'];;
	var name_arr = pxdata || ['项目1', '项目2', '项目3', '项目4'];
	var ydata = pydata || S_mock.array(name_arr.length, 100, 200);
	var seri_data = [];
	var dw = '';
	for(var key in name_arr) {
		seri_data.push({
			name: name_arr[key],
			value: ydata[key]
		})
	}
	var option = {
		color: color_arr,
		title: {
			show: false,
			left: 'center',
			top: 'top',
			text: '标题',
			textStyle: {
				fontWeight: 'normal',
				color: '#facc14',
			},
		},
		tooltip: {
			trigger: 'item',
			formatter: "{b}: {c} ({d}%)"
		},
		legend: {
			y: 'center',
			right: '10%',
			itemWidth: 15,
			itemHeight: 5,
			itemGap: getSize(0.1),
			icon: 'roundRect',
			formatter: function(para) {
				var str = '{a|' + para + '  } {b|';
				str += ydata[name_arr.indexOf(para)] + '}  {c|' + dw + '}';
				if(para = '其他') {
					str = str.replace(/其他/, '其他');
				}
				return str;
			},
			textStyle: {
				padding: [getSize(0.1), getSize(0.2), 0, 0],
				rich: {
					a: {
						fontSize: getSize(0.3),
						color: '#fff'
					},
					b: {
						fontSize: getSize(0.3),
						color: '#00EAFF'
					},
					c: {
						fontSize: getSize(0.24),
						color: '#fff'
					}
				}
			},
			orient: 'vertical', //horizontal 水平 vertical 垂直
			data: name_arr
		},
		series: [{
			name: '',
			type: 'pie',
			clockWise: false,
			hoverAnimation: false,
			center: ['30%', '50%'],
			radius: ['50%', '75%'],
			startAngle: 90,
			label: {
				show: false,
				fontSize: 16,
				fontFamily: 'DIN',
				position: 'center',
				formatter: '{a|' + getArrSum(ydata) + '}\n{b|总计}',
				rich: {
					a: {
						fontSize: getSize(0.44),
						color: '#FFA800'
					},
					b: {
						fontSize: getSize(0.24),
						color: '#fff'
					}
				}
			},
			labelLine: {
				show: true
			},
			data: seri_data
		}, {
			type: 'pie',
			zlevel: 1,
			silent: true,
			/*
			radius
			饼图的半径。可以为如下类型：
			number：直接指定外半径值。
			string：例如，'20%'，表示外半径为可视区尺寸（容器高宽中较小一项）的 20% 长度。
			Array.<number|string>：数组的第一项是内半径，第二项是外半径。每一项遵从上述 number string 的描述。
			*/
			center: ['30%', '50%'],
			radius: ['83%', '84%'],
			hoverAnimation: false,
			//color: "rgba(88,142,197,0.5)",
			color: '#445676',
			// animation:false,    //charts3 no
			label: {
				normal: {
					show: false
				},
			},
			labelLine: {
				normal: {
					show: false
				}
			},
			data: [1]
		}, {
			type: 'pie',
			zlevel: 1,
			silent: true,
			/*
			radius
			饼图的半径。可以为如下类型：
			number：直接指定外半径值。
			string：例如，'20%'，表示外半径为可视区尺寸（容器高宽中较小一项）的 20% 长度。
			Array.<number|string>：数组的第一项是内半径，第二项是外半径。每一项遵从上述 number string 的描述。
			*/
			center: ['30%', '50%'],
			radius: ['43%', '44%'],
			hoverAnimation: false,
			//color: "rgba(88,142,197,0.5)",
			color: '#445676',
			// animation:false,    //charts3 no
			label: {
				normal: {
					show: false
				},
			},
			labelLine: {
				normal: {
					show: false
				}
			},
			data: [2]
		}]
	}
	mychart.setOption(option);
};

//饼图-12
var chart_pie_12 = function(pxdata, pydata, unit) {
	var myChart = echarts.init(document.getElementById('pie-12'));
	var nameArr = pxdata || ['大盛村', '深里村', '芳树村', '四堡村', '剡溪村'];
	var valueArr = pydata || S_mock.array(5, 100, 200);
	var colorArr = ['#3e8bfe', '#ecca2b', '#f44786', '#2ed892', '#1cdced'];
	var dw = unit || '户';
	var echartData = [];
	var echartData2 = [];
	for(var key in nameArr) {
		echartData.push({
			name: nameArr[key],
			value: valueArr[key],
			itemStyle: {
				color: colorArr[key],
			},
		});
		echartData2.push({
			name: nameArr[key],
			value: valueArr[key],
			itemStyle: {
				color: 'rgba(255,255,255,0.6)',
			},
		})
	}
	option = {
		tooltip: {
			trigger: 'item',
			formatter: '{b}:{c}（户）'
		},
		legend: {
			orient: 'vertical',
			icon: 'circle',
			x: '65%',
			y: 'center',
			itemWidth: getSize(0.15),
			itemHeight: getSize(0.15),
			itemGap: getSize(0.3),
			align: 'left',
			//selectedMode: false,
			formatter: function(para) {
				var pct = valueArr[nameArr.indexOf(para)];
				var str = '{a|' + para + '}';
				if(nameArr.indexOf(para) === 0) {
					str += '{b|' + pct + '户}';
				} else if(nameArr.indexOf(para) === 1) {
					str += '{c|' + pct + '户}';
				} else if(nameArr.indexOf(para) === 2) {
					str += '{d|' + pct + '户}';
				} else if(nameArr.indexOf(para) === 3) {
					str += '{e|' + pct + '户}';
				} else if(nameArr.indexOf(para) === 4) {
					str += '{f|' + pct + '户}';
				}
				return str;
			},
			textStyle: {
				color: '#fff',
				rich: {
					a: {
						//padding: [0, 5, 0, 0],
						fontFamily: 'PingFang SC',
						fontSize: getSize(0.26),
					},
					b: {
						fontSize: getSize(0.26),
						//color: colorArr[0]
					},
					c: {
						fontSize: getSize(0.26),
						//color: colorArr[1]
					},
					d: {
						fontSize: getSize(0.26),
						//color: colorArr[2]
					},
					e: {
						fontSize: getSize(0.26),
						//color: colorArr[3]
					},
					f: {
						fontSize: getSize(0.26),
						//color: colorArr[3]
					}
				}
			},
		},
		series: [{
				name: '',
				type: 'pie',
				radius: ['50%', '80%'],
				center: ['40%', '50%'],
				avoidLabelOverlap: false,
				label: {
					align: 'center',
					normal: {
						show: false,
						position: 'center',
						formatter: function(data) {
							// 设置圆饼图中间文字排版
							// return data.value + '\n' + data.name;
							return '{value|' + data.value + '户}\n{name|' + data.name + '}';
						},
					},
					emphasis: {
						show: true, //文字至于中间时，这里需为true
						textStyle: {
							rich: {
								name: {
									color: '#ecca2b',
									fontSize: getSize(0.26),
								},
								value: {
									color: '#fff',
									padding: [5, 0, 5, 0],
									fontSize: getSize(0.26),
								},
							},
						},
					},
				},
				itemStyle: {
					normal: {
						label: {
							show: false,
						},
						labelLine: {
							show: false,
						},
						shadowBlur: 10,
						shadowColor: 'rgba(142, 152, 241, 0.6)',
					},
				},
				data: echartData,
				hoverAnimation: false,
			},
			{
				name: '',
				type: 'pie',
				radius: ['50%', '65%'],
				center: ['40%', '50%'],
				avoidLabelOverlap: false,
				label: {
					align: 'center',
					normal: {
						show: false,
						position: 'center',
						formatter: function(data) {
							// 设置圆饼图中间文字排版
							// return data.value + '\n' + data.name;
							return '{value|' + data.value + dw + '}\n{name|' + data.name + '}';
						},
					},
					emphasis: {
						show: true, //文字至于中间时，这里需为true
						textStyle: {
							rich: {
								name: {
									color: '#ecca2b',
									fontSize: getSize(0.26),
								},
								value: {
									color: '#fff',
									padding: [5, 0, 5, 0],
									fontSize: getSize(0.26),
								},
							},
						},
					},
				},
				itemStyle: {
					normal: {
						label: {
							show: false,
						},
						labelLine: {
							show: false,
						},
					},
				},
				data: echartData2,
				hoverAnimation: false,
			},
		],
	};

	myChart.setOption(option);
	myChart.resize();
	var index;

	//设置默认选中高亮部分
	//myChart.dispatchAction({
	//type: 'highlight',
	//seriesIndex: 0,
	//dataIndex: 0
	//});
	// 当鼠标移入时，如果不是第一项，则把当前项置为选中，如果是第一项，则设置第一项为当前项
	myChart.on('mouseover', function(e) {
		myChart.dispatchAction({
			type: 'downplay',
			seriesIndex: 0,
			dataIndex: 0
		});
		if(e.dataIndex != index) {
			myChart.dispatchAction({
				type: 'downplay',
				seriesIndex: 0,
				dataIndex: index
			});
		}
		if(e.dataIndex == 0) {
			myChart.dispatchAction({
				type: 'highlight',
				seriesIndex: 0,
				dataIndex: e.dataIndex
			});
		}
	});

	//当鼠标离开时，把当前项置为选中
	myChart.on('mouseout', function(e) {
		index = e.dataIndex;
		myChart.dispatchAction({
			type: 'highlight',
			seriesIndex: 0,
			dataIndex: e.dataIndex
		});
	});
};